#pragma once
#include <string>
#include <map>
#include <vector>

class Variant{
public:
	enum VariantType{
		VAR_NULL,
		VAR_BOOL,
		VAR_INT,
		VAR_DOUBLE,
		VAR_PTR,
		VAR_STRING,
		VAR_VECTOR,
		VAR_MAP,
	};

	union {
		int iData;
		double dData;
		bool bData;
		void *pData;
	};
	std::string strData;
	std::vector<Variant> vecData;
	VariantType dataType;
	std::map<std::string,Variant> mapData;

public:
	Variant();

	Variant(const int iData);
	Variant(const double dData);
	Variant(void* pData);
	Variant(const bool bData);

	explicit Variant(const std::string &strData);
	Variant(const std::vector<Variant> &vecVar);
	Variant(const std::map<std::string,Variant> &varMap);

	void operator = (const bool& b);
	void operator = (const int& b);
	void operator = (const double& b);
    void operator = (const std::string& strData);
};
